<style>
	.consult {
		padding-bottom: 8px;
		border-bottom: 1px solid #e5e5e5;
		margin-bottom: 15px;
	}
	
	.consult-head {
		position: relative;
		height: 50px;
		margin-bottom: 12px;
	}
	
	.consult-head .user-avatar {
		position: absolute;
		top: 0;
		left: 0;
		width: 50px;
		height: 50px;
	}
	
	.consult-head .user-avatar img {
		width: 50px;
		height: 50px;
		border-radius: 50%;
	}
	
	.consult-head .user-info {
		padding-left: 60px;
		min-height: 42px;
	}
	
	.consult-head .user-info .name {
		color: #293233;
		font-size: 15px;
		line-height: 20px;
		margin-bottom: 5px;
	}
	
	.consult-head .user-info .time {
		color: #7e8a8c;
		font-size: 13px;
		line-height: 17px;
	}
	
	.consult .consult-text {
		font-size: 15px;
		line-height: 20px;
		margin: 0 0 8px;
	}
	
	.comments-list .comments-item {
		position: relative;
	}
	
	.comments-list .comments-item .reply {
		padding: 0 0 15px 40px;
	}
	
	.comments-list .avatar {
		position: absolute;
		left: 0;
		top: 0;
	}
	
	.comments-list .avatar img {
		width: 30px;
		height: 30px;
		border-radius: 50%;
	}
	
	.comments-list .cont {
		font-size: 13px;
		line-height: 19px;
	}
	
	.comments-list .name {
		margin-right: 8px;
		color: #157c8c;
	}
	
	.comments-list .time {
		color: #7e8a8c;
	}
</style>
<div class="modal-dialog" role="document">
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			<h4 class="modal-title" id="exampleModalLabel">回复</h4>
		</div>
		<form style="padding:4%;height:500px;overflow-y:auto;" id="replyForm" data-toggle="validator" role="form">
			<div class="consult">
				<div class="consult-head">
					<div class="user-avatar"><img src="{$consult.consult_id|getAvatar}"></div>
					<div class="user-info">
						<div class="name">{$consult.consult_id|getUserName}</div>
						<div class="time">{$consult.consult_time|date='Y-m-d H:i',###}</div>
					</div>
				</div>
				<div class="consult-text">{$consult.content}</div>
			</div>
			<div class="comments-list">
				<ul>
                    <volist name="reply" id="item">
					<li class="comments-item">
						<div class="reply">
							<div class="avatar"><img src="{$item.reply_id|getAvatar}"></div>
							<div class="cont">
								<div><span class="name">{$item.reply_id|getUserName}</span><span class="time">{$item.reply_time|date='m-d H:i',###}</span></div>
								<div class="text">{$item.content}</div>
							</div>
						</div>
					</li>
                    </volist>
				</ul>
			</div>
			<div class="form-group">
				<label for="recipient-name" class="control-label">回复内容:</label>
				<textarea class="form-control" rows="5" name="content"></textarea>
			</div>
			<input type="hidden" name="consult_id" value="{$id}" />
		</form>
		<div class="modal-footer">
			<button type="button" data-dismiss="modal" class="btn btn-default">取消</button>
			<button type="button" id="replySave" class="btn btn-primary">保存</button>
		</div>
	</div>
</div>
<script type="text/javascript" src="__PUBLIC__/js/jquery-upload/js/vendor/jquery.ui.widget.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-upload/js/jquery.fileupload.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-upload/js/jquery.fileupload-ui.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-upload/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-upload/js/jquery.fileupload-process.js"></script>

<script>
	$("#replySave").click(function() {
		$.ajax({
			url: "{:U('Admin/Consulting/doReply')}",
			type: "post",
			dataType: "json",
			data: $("#replyForm").serialize(),
			success: function(data) {
				if(data.status) {
					$("#commonModal").modal('toggle');
					common.alert("提示", data.msg, function() {
						common.reload();
					});
				} else {
					common.alert("提示", data.msg)
				}
			}
		})
	})
</script>